package com.huawei.petapp2.provider;


import androidx.appcompat.widget.AppCompatImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.provider.BaseItemProvider;
import com.huawei.petapp2.R;
import com.huawei.petapp2.adapter.TestHomeAdapter;
import com.huawei.petapp2.entity.Recomment;


/**
 * Created by 吕氏春秋i 2020/4/30
 * Describe:
 */


public class ThreeColumnItemProvider extends BaseItemProvider<Recomment, BaseViewHolder> {
    @Override
    public int viewType() {
        return TestHomeAdapter.TYPE_THREE_COLUMN;
    }

    @Override
    public int layout() {
        return R.layout.app_item_home_three_column;
    }

    @Override
    public void convert(BaseViewHolder helper, Recomment data, int position) {

            helper.setText(R.id.item_tv,  data.getProductName() + "");
            Glide.with(mContext)
                    .load(data.getImgs().get(0))
                    .dontAnimate()
                    .into((AppCompatImageView) helper.getView(R.id.item_img));


    }

}
